package com.yifushidai.api;

import com.yifushidai.service.RemarkService;
import com.yifushidai.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Api(tags = "留言")
@RequestMapping("/api/remark")
public class RemarkController {

    @Autowired
    private RemarkService remarkService;

    @PostMapping("/upremark")
    @ApiOperation(value = "上传留言接口", notes = "上传留言", produces = MediaType.APPLICATION_JSON_VALUE)
    public R upremark(@ApiParam(value = "留言内容", required = true) @RequestParam String remarkStr) throws Exception {
        return remarkService.upremark(remarkStr);
    }
}
